<?php
require("../../class2.php");
require("library/api.php");

$orderID      = $tp->toDB($_REQUEST["orderID"]);
$status       = $tp->toDB($_REQUEST["STATUS"]);
$notify_email =  $shop_settings["order_email"]; //email address to which debug emails are sent to

if ($status=='52' || $status=='92') $errormsg = "Niet zeker of betaald is.";

if (strlen($errormsg) == 0) { 
    // nu naar de database schrijven
    if ($status=="5" || $status=="51" || $status="9" || $status=="91") {
        e107shop_pay_order($orderID);
    } else {
        mail($notify_email, "WACHTEN OP BETALING", "Order $orderID wacht nog steeds op betaling\r\n\r\n
        Status: ".$status);
    }
} else {
    mail($notify_email, "PROBLEEM MET BETALING", "Er is iets mis met Order $orderID\r\n\r\nStatus: "
    .$status."\r\nErrormelding: ".$errormsg);
}
